<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initAutoload()
    {
        $autoloader = new Zend_Application_Module_Autoloader(array(
            'namespace' => 'Default_',
            'basePath'  => dirname(__FILE__),
        ));
        return $autoloader;
    }

    protected function _initSession()
    {
        Zend_Session::start();
    }

    protected function _initLogger()
    {
        $logger = new Zend_Log();
        $writer = new Zend_Log_Writer_Stream('php://stderr');
        $logger->addWriter($writer);

        Zend_Registry::set('logger', $logger);
    }

    protected function _initDoctype()
    {
        $this->bootstrap('view');
        $view = $this->getResource('view');
        $view->doctype('XHTML1_STRICT');
    }

    protected function _initMoriarty()
    {
        define('MORIARTY_ARC_DIR', '../library/arc/');
//TODO Need to enable these once Moriarty is working with PhpHttpClient again.
//        require_once '../library/httpclient/http.php';
//        require_once '../library/sasl/sasl.php';
        require_once '../library/moriarty/moriarty.inc.php';
    }

    protected function _initTimezone()
    {
    	//TODO Is there a more Zend-approved way of doing this?
    	date_default_timezone_set('Europe/London');
    }
}
